import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '是否删除',
    align:"center",
    dataIndex: 'trash'
   },
   {
    title: '证件类型',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '证件号短标识',
    align:"center",
    dataIndex: 'idnumber'
   },
   {
    title: '行程开始日期',
    align:"center",
    dataIndex: 'startdate'
   },
   {
    title: '行程结束日期',
    align:"center",
    dataIndex: 'enddate'
   },
   {
    title: '旅游行程id',
    align:"center",
    dataIndex: 'travelid'
   },
   {
    title: '游客订单id',
    align:"center",
    dataIndex: 'tourorderid'
   },
   {
    title: '联系人id',
    align:"center",
    dataIndex: 'contactuserid'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '是否删除',
    field: 'trash',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否删除!'},
          ];
     },
  },
  {
    label: '证件类型',
    field: 'type',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入证件类型!'},
          ];
     },
  },
  {
    label: '证件号短标识',
    field: 'idnumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入证件号短标识!'},
          ];
     },
  },
  {
    label: '行程开始日期',
    field: 'startdate',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入行程开始日期!'},
          ];
     },
  },
  {
    label: '行程结束日期',
    field: 'enddate',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入行程结束日期!'},
          ];
     },
  },
  {
    label: '旅游行程id',
    field: 'travelid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入旅游行程id!'},
          ];
     },
  },
  {
    label: '游客订单id',
    field: 'tourorderid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入游客订单id!'},
          ];
     },
  },
  {
    label: '联系人id',
    field: 'contactuserid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入联系人id!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}